//
//  MessageViewController.m
//  PigMarket
//
//  Created by mac on 2019/3/23.
//  Copyright © 2019 felix.pigmarket.oc. All rights reserved.
//

#import "MessageViewController.h"
#import "MessageCell.h"
//#import "OrderFormViewController.h"

@interface MessageViewController ()<UITableViewDelegate, UITableViewDataSource , UIScrollViewDelegate>

/**
 myTbaleView
 */
@property (nonatomic , strong) UITableView *myTableView;
/**
 dataArr
 */
@property (nonatomic , strong) NSArray *dataArr;


@end

@implementation MessageViewController


#pragma mark - view life cycle

- (void)setupUI{
    
    self.baseNavView.hidden = YES;
    self.view.backgroundColor = KWhiteColor;
}

- (void)setupLayout{
    
}


- (void)initData {
    
    self.dataArr = @[@{@"icon":@"message_basicoperation", @"messageNum":@"3", @"title":@"基础操作", @"detail":@"哈哈被带回家不到货时间订货会电视剧",@"time":@"2019-09-34"},
                     @{@"icon":@"message_orderform",@"messageNum":@"4",@"title":@"消费、订单",@"detail":@"",@"time":@"2090-09-09 20:30"},
                     @{@"icon":@"message_earning",@"messageNum":@"10",@"title":@"入账收入",@"detail":@"",@"time":@""},
                     @{@"icon":@"message_logistics",@"messageNum":@"100",@"title":@"物流配送",@"detail":@"",@"time":@""},
                     @{@"icon":@"message_system",@"messageNum":@"",@"title":@"系统内推",@"detail":@"",@"time":@""},
                     @{@"icon":@"message_remind",@"messageNum":@"",@"title":@"引导提醒",@"detail":@"",@"time":@""}];
}

#pragma mark - delegate

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.dataArr.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MessageCell *cell = [MessageCell cellWithTableView:tableView];
    cell.infoDic = self.dataArr[indexPath.row];
    return cell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (indexPath.row == 0) {//基础操作
        
    }else if (indexPath.row == 1) {//消费订单
        
    }else if (indexPath.row == 2) {//入账收入
        
    }else if (indexPath.row == 3) {//物流配送
        
    }else if (indexPath.row == 4) {//系统内推
        
    }else if (indexPath.row == 5) {//引导提醒
        
    }
}

#pragma mark - target action

#pragma mark - private method

#pragma mark - getter and setter

- (void)registerTableViewCell{
    
    self.tableView.rowHeight = 70;
    self.tableView.separatorColor = mIconLineColor;
    self.tableView.backgroundColor = KWhiteColor;
    self.tableView.mj_footer.hidden = YES;
    self.tableView.mj_header.hidden = YES;
    
    self.tableView.mj_y = 20;
    self.tableView.height = KScreenHeight - self.tableView.mj_y;
    

}

- (NSArray *)dataArr {
    if (!_dataArr) {
        _dataArr = [[NSArray alloc] init];
    }
    return _dataArr;
}

@end
